{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "705a9a6f",
   "metadata": {},
   "source": [
    "# Backtesting a Strategy\n",
    "\n",
    "We're all set to test a basic trading strategy using **PyBroker**! To get started, we'll import the necessary classes listed below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f6d5005c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<diskcache.core.Cache at 0x7f453c0a85b0>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pybroker\n",
    "from pybroker import Strategy, StrategyConfig, YFinance\n",
    "\n",
    "pybroker.enable_data_source_cache('my_strategy')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "78feb741",
   "metadata": {},
   "source": [
    "For our backtest, we'll be using [Yahoo Finance](https://finance.yahoo.com) as our [DataSource](https://www.pybroker.com/en/latest/reference/pybroker.data.html#pybroker.data.DataSource). We'll also be using data source caching to ensure that we only download the necessary data once when we run our backtests.\n",
    "\n",
    "The next step is to set up a new instance of the [Strategy](https://www.pybroker.com/en/latest/reference/pybroker.strategy.html#pybroker.strategy.Strategy) class which will be used to perform a backtest on our trading strategy. Here's how you can do it:\n",
    "\n",
    "First, you can create a [StrategyConfig](https://www.pybroker.com/en/latest/reference/pybroker.config.html#pybroker.config.StrategyConfig) object to configure the ```Strategy```. In this case, we're setting the initial cash to ```500,000```:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "b11c16c7",
   "metadata": {},
   "outputs": [],
   "source": [
    "config = StrategyConfig(initial_cash=500_000)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d2034e6b",
   "metadata": {},
   "source": [
    "Then, you can create a new instance of the ```Strategy``` class by passing in the following arguments:\n",
    "\n",
    "- A data source: In this case, we're using Yahoo Finance as the data source.\n",
    "- A start date: This is the starting date for the backtest.\n",
    "- An end date: This is the end date for the backtest.\n",
    "- The configuration object created earlier."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a8ba4b29",
   "metadata": {},
   "outputs": [],
   "source": [
    "strategy = Strategy(YFinance(), '3/1/2017', '3/1/2022', config)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dfd3cc49",
   "metadata": {},
   "source": [
    "The ```Strategy``` instance is now ready to download data from Yahoo Finance for the period between March 1, 2017, and March 1, 2022, before running the backtest using the specified configuration options. If you need to modify other configuration options, you can refer to the [StrategyConfig reference documentation](https://www.pybroker.com/en/latest/reference/pybroker.config.html#pybroker.config.StrategyConfig).\n",
    "\n",
    "## Defining Strategy Rules\n",
    "\n",
    "In this section, you will learn how to implement a basic trading strategy in **PyBroker** with the following rules:\n",
    "\n",
    "1. Buy shares in a stock if the last close price is less than the low of the previous bar and there is no open long position in that stock.\n",
    "2. Set the limit price of the buy order to 0.01 less than the last close price.\n",
    "3. Hold the position for 3 days before liquidating it at market price.\n",
    "4. Trade the rules on AAPL and MSFT, allocating up to 25% of the portfolio to each.\n",
    "\n",
    "To accomplish this, you will define a ```buy_low``` function that **PyBroker** will call separately for AAPL and MSFT on every bar of data. Each bar corresponds to a single day of data:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "211dee24",
   "metadata": {},
   "outputs": [],
   "source": [
    "def buy_low(ctx):\n",
    "    # If shares were already purchased and are currently being held, then return.\n",
    "    if ctx.long_pos():\n",
    "        return\n",
    "    # If the latest close price is less than the previous day's low price,\n",
    "    # then place a buy order.\n",
    "    if ctx.bars >= 2 and ctx.close[-1] < ctx.low[-2]:\n",
    "        # Buy a number of shares that is equal to 25% the portfolio.\n",
    "        ctx.buy_shares = ctx.calc_target_shares(0.25)\n",
    "        # Set the limit price of the order.\n",
    "        ctx.buy_limit_price = ctx.close[-1] - 0.01\n",
    "        # Hold the position for 3 bars before liquidating (in this case, 3 days).\n",
    "        ctx.hold_bars = 3"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e5ac156a",
   "metadata": {},
   "source": [
    "That is a lot to unpack! The ```buy_low``` function will receive an [ExecContext](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext) (```ctx```) containing data for the current ticker symbol (AAPL or MSFT). The ```ExecContext``` will contain all of the close prices up until the most recent bar of the current ticker symbol. The latest close price is retrieved with ```ctx.close[-1]```.\n",
    "\n",
    "The ```buy_low``` function will use the ```ExecContext``` to place a buy order. The number of shares to purchase is set using [ctx.buy_shares](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext.buy_shares), which is calculated with [ctx.calc_target_shares](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext.calc_target_shares). In this case, the number of shares to buy will be equal to 25% of the portfolio. \n",
    "\n",
    "The limit price of the order is set with [buy_limit_price](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext.buy_limit_price). If the criteria are met, the buy order will be filled on the next bar. The time at which the order is filled can be configured with [StrategyConfig.buy_delay](https://www.pybroker.com/en/latest/reference/pybroker.config.html#pybroker.config.StrategyConfig.buy_delay), and its fill price can be set with [ExecContext.buy_fill_price](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext.buy_fill_price). By default, buy orders are filled on the next bar (```buy_delay=1```) and at a [fill price equal to the midpoint between that bar's low and high price](https://www.pybroker.com/en/latest/reference/pybroker.common.html#pybroker.common.PriceType.MIDDLE).\n",
    "\n",
    "Finally, [ctx.hold_bars](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext.hold_bars) specifies how many bars to hold the position for before liquidating it. When liquidated, the shares are sold at market price equal to [ExecContext.sell_fill_price](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext.sell_fill_price), which is configurable and defaults to the midpoint between the bar's low and high price.\n",
    "\n",
    "To add the ```buy_low``` rules to the ```Strategy``` for AAPL and MSFT, you will use [add_execution](https://www.pybroker.com/en/latest/reference/pybroker.strategy.html#pybroker.strategy.Strategy.add_execution):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "dc5b3abb",
   "metadata": {},
   "outputs": [],
   "source": [
    "strategy.add_execution(buy_low, ['AAPL', 'MSFT'])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "03747c70",
   "metadata": {},
   "source": [
    "## Adding a Second Execution\n",
    "\n",
    "You can use different sets of trading rules for different tickers within the same ```Strategy``` instance. In other words, you are not restricted to using only one set of trading rules for a single group of tickers. \n",
    "\n",
    "To demonstrate this, a new set of rules for a short strategy is provided in a function called ```short_high```, which is similar to the previous set of rules:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "4d2c7dfa",
   "metadata": {},
   "outputs": [],
   "source": [
    "def short_high(ctx):\n",
    "    # If shares were already shorted then return.\n",
    "    if ctx.short_pos():\n",
    "        return\n",
    "    # If the latest close price is more than the previous day's high price,\n",
    "    # then place a sell order.\n",
    "    if ctx.bars >= 2 and ctx.close[-1] > ctx.high[-2]:\n",
    "        # Short 100 shares.\n",
    "        ctx.sell_shares = 100\n",
    "        # Cover the shares after 2 bars (in this case, 2 days).\n",
    "        ctx.hold_bars = 2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "429b8bfe",
   "metadata": {},
   "source": [
    "The rules in ```short_high``` will be traded on ```TSLA```:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "33a35251",
   "metadata": {},
   "outputs": [],
   "source": [
    "strategy.add_execution(short_high, ['TSLA'])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2ebab489",
   "metadata": {},
   "source": [
    "(Note, you can also retrieve bar data for another symbol by calling [ExecContext#foreign](https://www.pybroker.com/en/latest/reference/pybroker.context.html#pybroker.context.ExecContext.foreign))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "52d9e84b",
   "metadata": {},
   "source": [
    "## Running a Backtest\n",
    "\n",
    "To run a backtest, call the [backtest](https://www.pybroker.com/en/latest/reference/pybroker.strategy.html#pybroker.strategy.Strategy.backtest) method on the ```Strategy``` instance. Here is an example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "df621c7f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Backtesting: 2017-03-01 00:00:00 to 2022-03-01 00:00:00\n",
      "\n",
      "Loading bar data...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[*********************100%***********************]  3 of 3 completed"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loaded bar data: 0:00:01 \n",
      "\n",
      "Test split: 2017-03-01 00:00:00 to 2022-02-28 00:00:00\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "\u001b[38;2;0;255;0m100%\u001b[39m \u001b[38;2;0;255;0m(1259 of 1259)\u001b[39m |####################| Elapsed Time: 0:00:00 Time:  0:00:000:00\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Finished backtest: 0:00:03\n"
     ]
    }
   ],
   "source": [
    "result = strategy.backtest()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "11651114",
   "metadata": {},
   "source": [
    "That was fast! The ```backtest``` method will return an instance of [TestResult](https://www.pybroker.com/en/latest/reference/pybroker.strategy.html#pybroker.strategy.TestResult). You can access various information and metrics about the backtest through this instance. For example, to see the daily balances of the portfolio, you can plot the market value using [Matplotlib](https://matplotlib.org/):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "6c6bd67e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f44544ecfd0>]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkIAAAGdCAYAAAD+JxxnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYX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ELRYDISIiImqxGAgRERFRi8VAiIiIiFosBkJERETUYjEQIiIiohbr/wPSdmvrTXMbcQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "chart = plt.subplot2grid((3, 2), (0, 0), rowspan=3, colspan=2)\n",
    "chart.plot(result.portfolio.index, result.portfolio['market_value'])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1cefab33",
   "metadata": {},
   "source": [
    "You can also access the daily balance of each position that was held, the trades that were made for every entry and exit, and all of the orders that were placed:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "6f219096",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>long_shares</th>\n",
       "      <th>short_shares</th>\n",
       "      <th>close</th>\n",
       "      <th>equity</th>\n",
       "      <th>market_value</th>\n",
       "      <th>margin</th>\n",
       "      <th>unrealized_pnl</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>symbol</th>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">MSFT</th>\n",
       "      <th>2017-03-03</th>\n",
       "      <td>1952</td>\n",
       "      <td>0</td>\n",
       "      <td>64.25</td>\n",
       "      <td>125416.00</td>\n",
       "      <td>125416.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>585.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-03-06</th>\n",
       "      <td>1952</td>\n",
       "      <td>0</td>\n",
       "      <td>64.27</td>\n",
       "      <td>125455.03</td>\n",
       "      <td>125455.03</td>\n",
       "      <td>0.00</td>\n",
       "      <td>624.63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-03-07</th>\n",
       "      <td>1952</td>\n",
       "      <td>0</td>\n",
       "      <td>64.40</td>\n",
       "      <td>125708.80</td>\n",
       "      <td>125708.80</td>\n",
       "      <td>0.00</td>\n",
       "      <td>878.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-03-14</th>\n",
       "      <td>1937</td>\n",
       "      <td>0</td>\n",
       "      <td>64.41</td>\n",
       "      <td>124762.18</td>\n",
       "      <td>124762.18</td>\n",
       "      <td>0.00</td>\n",
       "      <td>116.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TSLA</th>\n",
       "      <th>2017-03-15</th>\n",
       "      <td>0</td>\n",
       "      <td>100</td>\n",
       "      <td>17.05</td>\n",
       "      <td>0.00</td>\n",
       "      <td>1718.00</td>\n",
       "      <td>1704.87</td>\n",
       "      <td>13.13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MSFT</th>\n",
       "      <th>2022-02-22</th>\n",
       "      <td>583</td>\n",
       "      <td>0</td>\n",
       "      <td>287.72</td>\n",
       "      <td>167740.76</td>\n",
       "      <td>167740.76</td>\n",
       "      <td>0.00</td>\n",
       "      <td>-1375.88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAPL</th>\n",
       "      <th>2022-02-22</th>\n",
       "      <td>1005</td>\n",
       "      <td>0</td>\n",
       "      <td>164.32</td>\n",
       "      <td>165141.61</td>\n",
       "      <td>165141.61</td>\n",
       "      <td>0.00</td>\n",
       "      <td>-4060.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MSFT</th>\n",
       "      <th>2022-02-23</th>\n",
       "      <td>583</td>\n",
       "      <td>0</td>\n",
       "      <td>280.27</td>\n",
       "      <td>163397.40</td>\n",
       "      <td>163397.40</td>\n",
       "      <td>0.00</td>\n",
       "      <td>-5719.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAPL</th>\n",
       "      <th>2022-02-23</th>\n",
       "      <td>1005</td>\n",
       "      <td>0</td>\n",
       "      <td>160.07</td>\n",
       "      <td>160870.36</td>\n",
       "      <td>160870.36</td>\n",
       "      <td>0.00</td>\n",
       "      <td>-8331.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TSLA</th>\n",
       "      <th>2022-02-28</th>\n",
       "      <td>0</td>\n",
       "      <td>100</td>\n",
       "      <td>290.14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>28193.00</td>\n",
       "      <td>29014.33</td>\n",
       "      <td>-821.33</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>938 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   long_shares  short_shares   close     equity  market_value  \\\n",
       "symbol date                                                                     \n",
       "MSFT   2017-03-03         1952             0   64.25  125416.00     125416.00   \n",
       "       2017-03-06         1952             0   64.27  125455.03     125455.03   \n",
       "       2017-03-07         1952             0   64.40  125708.80     125708.80   \n",
       "       2017-03-14         1937             0   64.41  124762.18     124762.18   \n",
       "TSLA   2017-03-15            0           100   17.05       0.00       1718.00   \n",
       "...                        ...           ...     ...        ...           ...   \n",
       "MSFT   2022-02-22          583             0  287.72  167740.76     167740.76   \n",
       "AAPL   2022-02-22         1005             0  164.32  165141.61     165141.61   \n",
       "MSFT   2022-02-23          583             0  280.27  163397.40     163397.40   \n",
       "AAPL   2022-02-23         1005             0  160.07  160870.36     160870.36   \n",
       "TSLA   2022-02-28            0           100  290.14       0.00      28193.00   \n",
       "\n",
       "                     margin  unrealized_pnl  \n",
       "symbol date                                  \n",
       "MSFT   2017-03-03      0.00          585.60  \n",
       "       2017-03-06      0.00          624.63  \n",
       "       2017-03-07      0.00          878.40  \n",
       "       2017-03-14      0.00          116.23  \n",
       "TSLA   2017-03-15   1704.87           13.13  \n",
       "...                     ...             ...  \n",
       "MSFT   2022-02-22      0.00        -1375.88  \n",
       "AAPL   2022-02-22      0.00        -4060.19  \n",
       "MSFT   2022-02-23      0.00        -5719.24  \n",
       "AAPL   2022-02-23      0.00        -8331.44  \n",
       "TSLA   2022-02-28  29014.33         -821.33  \n",
       "\n",
       "[938 rows x 7 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.positions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "23c23031",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>type</th>\n",
       "      <th>symbol</th>\n",
       "      <th>entry_date</th>\n",
       "      <th>exit_date</th>\n",
       "      <th>entry</th>\n",
       "      <th>exit</th>\n",
       "      <th>shares</th>\n",
       "      <th>pnl</th>\n",
       "      <th>return_pct</th>\n",
       "      <th>agg_pnl</th>\n",
       "      <th>bars</th>\n",
       "      <th>pnl_per_bar</th>\n",
       "      <th>stop</th>\n",
       "      <th>mae</th>\n",
       "      <th>mfe</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>long</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2017-03-03</td>\n",
       "      <td>2017-03-08</td>\n",
       "      <td>63.95</td>\n",
       "      <td>64.67</td>\n",
       "      <td>1952</td>\n",
       "      <td>1405.44</td>\n",
       "      <td>1.13</td>\n",
       "      <td>1405.44</td>\n",
       "      <td>3</td>\n",
       "      <td>468.48</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.33</td>\n",
       "      <td>0.83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>long</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2017-03-14</td>\n",
       "      <td>2017-03-17</td>\n",
       "      <td>64.35</td>\n",
       "      <td>64.96</td>\n",
       "      <td>1937</td>\n",
       "      <td>1181.57</td>\n",
       "      <td>0.95</td>\n",
       "      <td>2587.01</td>\n",
       "      <td>3</td>\n",
       "      <td>393.86</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>0.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>short</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-03-15</td>\n",
       "      <td>2017-03-17</td>\n",
       "      <td>17.18</td>\n",
       "      <td>17.55</td>\n",
       "      <td>100</td>\n",
       "      <td>-37.00</td>\n",
       "      <td>-2.11</td>\n",
       "      <td>2550.01</td>\n",
       "      <td>2</td>\n",
       "      <td>-18.50</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.54</td>\n",
       "      <td>0.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>short</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-03-27</td>\n",
       "      <td>2017-03-29</td>\n",
       "      <td>17.68</td>\n",
       "      <td>18.50</td>\n",
       "      <td>100</td>\n",
       "      <td>-82.00</td>\n",
       "      <td>-4.43</td>\n",
       "      <td>2468.01</td>\n",
       "      <td>2</td>\n",
       "      <td>-41.00</td>\n",
       "      <td>bar</td>\n",
       "      <td>-1.03</td>\n",
       "      <td>0.36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>short</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-04-04</td>\n",
       "      <td>2017-04-06</td>\n",
       "      <td>19.98</td>\n",
       "      <td>19.87</td>\n",
       "      <td>100</td>\n",
       "      <td>11.00</td>\n",
       "      <td>0.55</td>\n",
       "      <td>2479.01</td>\n",
       "      <td>2</td>\n",
       "      <td>5.50</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.35</td>\n",
       "      <td>0.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>384</th>\n",
       "      <td>long</td>\n",
       "      <td>AAPL</td>\n",
       "      <td>2022-02-11</td>\n",
       "      <td>2022-02-16</td>\n",
       "      <td>170.56</td>\n",
       "      <td>171.69</td>\n",
       "      <td>984</td>\n",
       "      <td>1111.92</td>\n",
       "      <td>0.66</td>\n",
       "      <td>180139.06</td>\n",
       "      <td>3</td>\n",
       "      <td>370.64</td>\n",
       "      <td>bar</td>\n",
       "      <td>-4.00</td>\n",
       "      <td>2.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>385</th>\n",
       "      <td>long</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2022-02-11</td>\n",
       "      <td>2022-02-16</td>\n",
       "      <td>299.26</td>\n",
       "      <td>297.27</td>\n",
       "      <td>560</td>\n",
       "      <td>-1114.40</td>\n",
       "      <td>-0.66</td>\n",
       "      <td>179024.66</td>\n",
       "      <td>3</td>\n",
       "      <td>-371.47</td>\n",
       "      <td>bar</td>\n",
       "      <td>-7.91</td>\n",
       "      <td>5.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>386</th>\n",
       "      <td>short</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2022-02-16</td>\n",
       "      <td>2022-02-18</td>\n",
       "      <td>304.61</td>\n",
       "      <td>287.41</td>\n",
       "      <td>100</td>\n",
       "      <td>1720.00</td>\n",
       "      <td>5.98</td>\n",
       "      <td>180744.66</td>\n",
       "      <td>2</td>\n",
       "      <td>860.00</td>\n",
       "      <td>bar</td>\n",
       "      <td>-4.20</td>\n",
       "      <td>17.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>387</th>\n",
       "      <td>long</td>\n",
       "      <td>AAPL</td>\n",
       "      <td>2022-02-18</td>\n",
       "      <td>2022-02-24</td>\n",
       "      <td>168.36</td>\n",
       "      <td>157.43</td>\n",
       "      <td>1005</td>\n",
       "      <td>-10984.65</td>\n",
       "      <td>-6.49</td>\n",
       "      <td>169760.01</td>\n",
       "      <td>3</td>\n",
       "      <td>-3661.55</td>\n",
       "      <td>bar</td>\n",
       "      <td>-10.93</td>\n",
       "      <td>2.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>388</th>\n",
       "      <td>long</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2022-02-18</td>\n",
       "      <td>2022-02-24</td>\n",
       "      <td>290.08</td>\n",
       "      <td>283.34</td>\n",
       "      <td>583</td>\n",
       "      <td>-3929.42</td>\n",
       "      <td>-2.32</td>\n",
       "      <td>165830.59</td>\n",
       "      <td>3</td>\n",
       "      <td>-1309.81</td>\n",
       "      <td>bar</td>\n",
       "      <td>-9.98</td>\n",
       "      <td>3.78</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>388 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      type symbol entry_date  exit_date   entry    exit  shares       pnl  \\\n",
       "id                                                                          \n",
       "1     long   MSFT 2017-03-03 2017-03-08   63.95   64.67    1952   1405.44   \n",
       "2     long   MSFT 2017-03-14 2017-03-17   64.35   64.96    1937   1181.57   \n",
       "3    short   TSLA 2017-03-15 2017-03-17   17.18   17.55     100    -37.00   \n",
       "4    short   TSLA 2017-03-27 2017-03-29   17.68   18.50     100    -82.00   \n",
       "5    short   TSLA 2017-04-04 2017-04-06   19.98   19.87     100     11.00   \n",
       "..     ...    ...        ...        ...     ...     ...     ...       ...   \n",
       "384   long   AAPL 2022-02-11 2022-02-16  170.56  171.69     984   1111.92   \n",
       "385   long   MSFT 2022-02-11 2022-02-16  299.26  297.27     560  -1114.40   \n",
       "386  short   TSLA 2022-02-16 2022-02-18  304.61  287.41     100   1720.00   \n",
       "387   long   AAPL 2022-02-18 2022-02-24  168.36  157.43    1005 -10984.65   \n",
       "388   long   MSFT 2022-02-18 2022-02-24  290.08  283.34     583  -3929.42   \n",
       "\n",
       "     return_pct    agg_pnl  bars  pnl_per_bar stop    mae    mfe  \n",
       "id                                                                \n",
       "1          1.13    1405.44     3       468.48  bar  -0.33   0.83  \n",
       "2          0.95    2587.01     3       393.86  bar  -0.20   0.61  \n",
       "3         -2.11    2550.01     2       -18.50  bar  -0.54   0.23  \n",
       "4         -4.43    2468.01     2       -41.00  bar  -1.03   0.36  \n",
       "5          0.55    2479.01     2         5.50  bar  -0.35   0.37  \n",
       "..          ...        ...   ...          ...  ...    ...    ...  \n",
       "384        0.66  180139.06     3       370.64  bar  -4.00   2.52  \n",
       "385       -0.66  179024.66     3      -371.47  bar  -7.91   5.03  \n",
       "386        5.98  180744.66     2       860.00  bar  -4.20  17.20  \n",
       "387       -6.49  169760.01     3     -3661.55  bar -10.93   2.18  \n",
       "388       -2.32  165830.59     3     -1309.81  bar  -9.98   3.78  \n",
       "\n",
       "[388 rows x 15 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.trades"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "b659c48d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>type</th>\n",
       "      <th>symbol</th>\n",
       "      <th>date</th>\n",
       "      <th>shares</th>\n",
       "      <th>limit_price</th>\n",
       "      <th>fill_price</th>\n",
       "      <th>fees</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>buy</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2017-03-03</td>\n",
       "      <td>1952</td>\n",
       "      <td>64.00</td>\n",
       "      <td>63.95</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>sell</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2017-03-08</td>\n",
       "      <td>1952</td>\n",
       "      <td>NaN</td>\n",
       "      <td>64.67</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>buy</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2017-03-14</td>\n",
       "      <td>1937</td>\n",
       "      <td>64.70</td>\n",
       "      <td>64.35</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>sell</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-03-15</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>17.18</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>sell</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2017-03-17</td>\n",
       "      <td>1937</td>\n",
       "      <td>NaN</td>\n",
       "      <td>64.96</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>773</th>\n",
       "      <td>buy</td>\n",
       "      <td>AAPL</td>\n",
       "      <td>2022-02-18</td>\n",
       "      <td>1005</td>\n",
       "      <td>168.87</td>\n",
       "      <td>168.36</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>774</th>\n",
       "      <td>buy</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2022-02-18</td>\n",
       "      <td>583</td>\n",
       "      <td>290.72</td>\n",
       "      <td>290.08</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>775</th>\n",
       "      <td>sell</td>\n",
       "      <td>AAPL</td>\n",
       "      <td>2022-02-24</td>\n",
       "      <td>1005</td>\n",
       "      <td>NaN</td>\n",
       "      <td>157.43</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>776</th>\n",
       "      <td>sell</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2022-02-24</td>\n",
       "      <td>583</td>\n",
       "      <td>NaN</td>\n",
       "      <td>283.34</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>777</th>\n",
       "      <td>sell</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2022-02-28</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>281.93</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>777 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     type symbol       date  shares  limit_price  fill_price  fees\n",
       "id                                                                \n",
       "1     buy   MSFT 2017-03-03    1952        64.00       63.95   0.0\n",
       "2    sell   MSFT 2017-03-08    1952          NaN       64.67   0.0\n",
       "3     buy   MSFT 2017-03-14    1937        64.70       64.35   0.0\n",
       "4    sell   TSLA 2017-03-15     100          NaN       17.18   0.0\n",
       "5    sell   MSFT 2017-03-17    1937          NaN       64.96   0.0\n",
       "..    ...    ...        ...     ...          ...         ...   ...\n",
       "773   buy   AAPL 2022-02-18    1005       168.87      168.36   0.0\n",
       "774   buy   MSFT 2022-02-18     583       290.72      290.08   0.0\n",
       "775  sell   AAPL 2022-02-24    1005          NaN      157.43   0.0\n",
       "776  sell   MSFT 2022-02-24     583          NaN      283.34   0.0\n",
       "777  sell   TSLA 2022-02-28     100          NaN      281.93   0.0\n",
       "\n",
       "[777 rows x 7 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.orders"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5e21f15d",
   "metadata": {},
   "source": [
    "Additionally, ```result.metrics_df``` contains a DataFrame of metrics calculated using the returns of the backtest. [You can read about what these metrics mean on the reference documentation](https://www.pybroker.com/en/latest/reference/pybroker.eval.html#pybroker.eval.EvalMetrics)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "37aaf442",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>value</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>trade_count</td>\n",
       "      <td>388.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>initial_market_value</td>\n",
       "      <td>500000.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>end_market_value</td>\n",
       "      <td>665009.260000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>total_pnl</td>\n",
       "      <td>165830.590000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>unrealized_pnl</td>\n",
       "      <td>-821.330000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>total_return_pct</td>\n",
       "      <td>33.166118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>total_profit</td>\n",
       "      <td>402053.210000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>total_loss</td>\n",
       "      <td>-236222.620000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>total_fees</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>max_drawdown</td>\n",
       "      <td>-31619.460000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>max_drawdown_pct</td>\n",
       "      <td>-4.722785</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>win_rate</td>\n",
       "      <td>52.577320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>loss_rate</td>\n",
       "      <td>47.422680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>winning_trades</td>\n",
       "      <td>204.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>losing_trades</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>avg_pnl</td>\n",
       "      <td>427.398428</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>avg_return_pct</td>\n",
       "      <td>0.279639</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>avg_trade_bars</td>\n",
       "      <td>2.414948</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>avg_profit</td>\n",
       "      <td>1970.849069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>avg_profit_pct</td>\n",
       "      <td>3.168775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>avg_winning_trade_bars</td>\n",
       "      <td>2.465686</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>avg_loss</td>\n",
       "      <td>-1283.818587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>avg_loss_pct</td>\n",
       "      <td>-2.923533</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>avg_losing_trade_bars</td>\n",
       "      <td>2.358696</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>largest_win</td>\n",
       "      <td>20973.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>largest_win_pct</td>\n",
       "      <td>14.490000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>largest_win_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>largest_loss</td>\n",
       "      <td>-10984.650000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>largest_loss_pct</td>\n",
       "      <td>-6.490000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>largest_loss_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>max_wins</td>\n",
       "      <td>7.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>max_losses</td>\n",
       "      <td>7.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>sharpe</td>\n",
       "      <td>0.055208</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>sortino</td>\n",
       "      <td>0.061908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>profit_factor</td>\n",
       "      <td>1.317514</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>ulcer_index</td>\n",
       "      <td>0.659022</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>upi</td>\n",
       "      <td>0.035627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>equity_r2</td>\n",
       "      <td>0.902314</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>std_error</td>\n",
       "      <td>65830.655991</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      name          value\n",
       "0              trade_count     388.000000\n",
       "1     initial_market_value  500000.000000\n",
       "2         end_market_value  665009.260000\n",
       "3                total_pnl  165830.590000\n",
       "4           unrealized_pnl    -821.330000\n",
       "5         total_return_pct      33.166118\n",
       "6             total_profit  402053.210000\n",
       "7               total_loss -236222.620000\n",
       "8               total_fees       0.000000\n",
       "9             max_drawdown  -31619.460000\n",
       "10        max_drawdown_pct      -4.722785\n",
       "11                win_rate      52.577320\n",
       "12               loss_rate      47.422680\n",
       "13          winning_trades     204.000000\n",
       "14           losing_trades     184.000000\n",
       "15                 avg_pnl     427.398428\n",
       "16          avg_return_pct       0.279639\n",
       "17          avg_trade_bars       2.414948\n",
       "18              avg_profit    1970.849069\n",
       "19          avg_profit_pct       3.168775\n",
       "20  avg_winning_trade_bars       2.465686\n",
       "21                avg_loss   -1283.818587\n",
       "22            avg_loss_pct      -2.923533\n",
       "23   avg_losing_trade_bars       2.358696\n",
       "24             largest_win   20973.750000\n",
       "25         largest_win_pct      14.490000\n",
       "26        largest_win_bars       3.000000\n",
       "27            largest_loss  -10984.650000\n",
       "28        largest_loss_pct      -6.490000\n",
       "29       largest_loss_bars       3.000000\n",
       "30                max_wins       7.000000\n",
       "31              max_losses       7.000000\n",
       "32                  sharpe       0.055208\n",
       "33                 sortino       0.061908\n",
       "34           profit_factor       1.317514\n",
       "35             ulcer_index       0.659022\n",
       "36                     upi       0.035627\n",
       "37               equity_r2       0.902314\n",
       "38               std_error   65830.655991"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.metrics_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "84f5feaa",
   "metadata": {},
   "source": [
    "## Filtering Backtest Data\n",
    "\n",
    "You can filter the data used for the backtest to only include specific bars. For example, you can limit the strategy to trade only on Mondays by filtering the data to only contain bars for Mondays:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "506023e0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Backtesting: 2017-03-01 00:00:00 to 2022-03-01 00:00:00\n",
      "\n",
      "Loaded cached bar data.\n",
      "\n",
      "Test split: 2017-03-06 00:00:00 to 2022-02-28 00:00:00\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\u001b[38;2;0;255;0m100%\u001b[39m \u001b[38;2;0;255;0m(238 of 238)\u001b[39m |######################| Elapsed Time: 0:00:00 Time:  0:00:000:00\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Finished backtest: 0:00:00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>type</th>\n",
       "      <th>symbol</th>\n",
       "      <th>date</th>\n",
       "      <th>shares</th>\n",
       "      <th>limit_price</th>\n",
       "      <th>fill_price</th>\n",
       "      <th>fees</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>sell</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-03-27</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>17.68</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>buy</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-04-10</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20.75</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sell</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-04-17</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20.09</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>buy</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-05-01</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>21.40</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>sell</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2017-05-08</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20.65</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>sell</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2022-02-07</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>308.41</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>sell</td>\n",
       "      <td>AAPL</td>\n",
       "      <td>2022-02-14</td>\n",
       "      <td>777</td>\n",
       "      <td>NaN</td>\n",
       "      <td>168.07</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>buy</td>\n",
       "      <td>MSFT</td>\n",
       "      <td>2022-02-14</td>\n",
       "      <td>457</td>\n",
       "      <td>300.94</td>\n",
       "      <td>294.06</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>buy</td>\n",
       "      <td>TSLA</td>\n",
       "      <td>2022-02-28</td>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>281.93</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>buy</td>\n",
       "      <td>AAPL</td>\n",
       "      <td>2022-02-28</td>\n",
       "      <td>811</td>\n",
       "      <td>168.87</td>\n",
       "      <td>163.92</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>182 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     type symbol       date  shares  limit_price  fill_price  fees\n",
       "id                                                                \n",
       "1    sell   TSLA 2017-03-27     100          NaN       17.68   0.0\n",
       "2     buy   TSLA 2017-04-10     100          NaN       20.75   0.0\n",
       "3    sell   TSLA 2017-04-17     100          NaN       20.09   0.0\n",
       "4     buy   TSLA 2017-05-01     100          NaN       21.40   0.0\n",
       "5    sell   TSLA 2017-05-08     100          NaN       20.65   0.0\n",
       "..    ...    ...        ...     ...          ...         ...   ...\n",
       "178  sell   TSLA 2022-02-07     100          NaN      308.41   0.0\n",
       "179  sell   AAPL 2022-02-14     777          NaN      168.07   0.0\n",
       "180   buy   MSFT 2022-02-14     457       300.94      294.06   0.0\n",
       "181   buy   TSLA 2022-02-28     100          NaN      281.93   0.0\n",
       "182   buy   AAPL 2022-02-28     811       168.87      163.92   0.0\n",
       "\n",
       "[182 rows x 7 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result = strategy.backtest(days='mon')\n",
    "result.orders"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a83fcfe2",
   "metadata": {},
   "source": [
    "The data doesn't need to be downloaded again from Yahoo Finance because caching is enabled and the cached data only needs to be filtered.\n",
    "\n",
    "You can also filter the data by time range, such as 9:30-10:30 AM, using the [between_time](https://www.pybroker.com/en/latest/reference/pybroker.strategy.html#pybroker.strategy.Strategy.backtest) argument.\n",
    "\n",
    "Although the metrics earlier indicate that we have a profitable strategy, we may be misled by randomness. [In the next notebook, we'll discuss how to use bootstrapping to further evaluate our trading strategies](https://www.pybroker.com/en/latest/notebooks/3.%20Evaluating%20with%20Bootstrap%20Metrics.html)."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
